import java.util.*;

public class Test {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextLine()) { // 注意 while 处理多个 case
            String s1 = in.nextLine();//预期输出
            String s2 = in.nextLine();
            s1.toUpperCase();
            s2.toUpperCase();
            Set<Character> set1 = new HashSet<>();
            Set<Character> set2 = new HashSet<>();
            for (int i = 0; i < s1.length(); i++) {
                char ch = s1.charAt(i);
                set1.add(ch);
            }
            for (int i = 0; i < s2.length(); i++) {
                char ch = s2.charAt(i);
                if(!set1.contains(ch) && !set2.contains(ch)) {
                    set2.add(ch);
                    System.out.print(ch);
                }
            }
        }
    }

    /**
     *  统计出现频率前K个的单词
     */
    public List<String> topKFrequent(String[] words, int k) {
        //1.放入map中，统计每个单词出现的频率
        Map<String,Integer> map = new HashMap<>();
        for (String s:words) {
            if(map.get(s) == null) {
                map.put(s,1);
            }else {
                int val = map.get(s);
                map.put(s,val+1);
            }
        }
        //2.创建小根堆，找出出现频率前k个最高的
        PriorityQueue<Map.Entry<String,Integer>> minHeap = new PriorityQueue<>(new Comparator<Map.Entry<String, Integer>>() {
            @Override
            public int compare(Map.Entry<String, Integer> o1, Map.Entry<String, Integer> o2) {
                if(o1.getValue().compareTo(o2.getValue()) == 0) {
                    return o2.getKey().compareTo(o1.getKey());
                }
                return o1.getValue().compareTo(o2.getValue());
            }
        });
        //遍历map，创建top-k
        for (Map.Entry<String,Integer> entry : map.entrySet()) {
            if(minHeap.size() < k) {
                //前面k个元素直接存入，无需与顶部元素比较
                minHeap.offer(entry);
            }else {
                Map.Entry<String,Integer> top = minHeap.peek();
                //与顶部元素比较
                if(top.getValue().compareTo(entry.getValue()) < 0) {
                    minHeap.poll();
                    minHeap.offer(entry);
                }else {//出现频率相同，比较字母顺序
                    if(top.getValue().compareTo(entry.getValue()) == 0) {
                        if(top.getKey().compareTo(entry.getKey()) > 0) {
                            minHeap.poll();
                            minHeap.offer(entry);
                        }
                    }

                }
            }
        }
        //3.存入List中
        List<String> list = new LinkedList<>();
        for (int i = 0; i < k; i++) {
            Map.Entry<String,Integer> top = minHeap.poll();
            list.add(top.getKey());
        }
        Collections.reverse(list);//反转
        return list;
    }
}
